﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Reporting.Infrastructure.Migrations
{
    public partial class a2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Productionorder",
                columns: table => new
                {
                    Productionorderid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Workordernumber = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Workordername = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Workorderprogress = table.Column<int>(type: "int", nullable: false),
                    Productionplanid = table.Column<int>(type: "int", nullable: false),
                    Productname = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Productnumber = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Specificationandmodel = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ProductTypeID = table.Column<int>(type: "int", nullable: false),
                    Productionorderunit = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Requirementdate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Plannedproduction = table.Column<int>(type: "int", nullable: false),
                    Actualproductionquantity = table.Column<int>(type: "int", nullable: false),
                    Scheduledstarttime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Plannedendtime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Actualstarttime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Actualendtime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Productionorderstate = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Productionorder", x => x.Productionorderid);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "ProductType",
                columns: table => new
                {
                    ProductTypeID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    ProductTypeName = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProductType", x => x.ProductTypeID);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Productionorder");

            migrationBuilder.DropTable(
                name: "ProductType");
        }
    }
}
